﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoforFunction2
{
    class Program
    {
        /// <summary>
        /// 函数演示2
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            int i = 1;
            //i是实参
           // Console.WriteLine($"i is {i},Answer from function is {MyAnswer( i)}");
            //Console.WriteLine($"Answer from function is {MyAnswer(ref i)},i is {i}");
            string userInput = Console.ReadLine();
            if (int.TryParse(userInput,out int j))
            {
                Console.WriteLine($"Answer from function is {MyAnswer(ref j)},i is {j}");
            }
            Console.WriteLine("");
            string test = "hello";
         




            Console.ReadKey();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="para">形参</param>
        /// <returns></returns>
        static int MyAnswer(ref  int para)
        {
            para += 1;
            return para;

        }
    }
}
